﻿<phone:PhoneApplicationPage x:Class="wp8nop.MainPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:ignore="http://www.ignore.com"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            mc:Ignorable="d ignore"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True"
                            DataContext="{Binding Main, Source={StaticResource Locator}}" Background="Black" Loaded="PhoneApplicationPage_Loaded"
                            toolkit:TiltEffect.IsTiltEnabled="True">
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="VetrinaDataTemplate">
            <StackPanel Width="190" Margin="8">
                <Image Height="190" Width="190" Source="{Binding Model.imgs.thumb}"/>
                <TextBlock Margin="0,10,0,0" TextWrapping="Wrap" Text="{Binding Model.name}" HorizontalAlignment="Center" FontSize="20" Foreground="Black"></TextBlock>
                <TextBlock Margin="0,10,0,0" Text="{Binding Price}" HorizontalAlignment="Center" FontSize="20" Foreground="Black"></TextBlock>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="CategorieTemplate">
            <StackPanel Orientation="Horizontal">
                <Image Width="50" Height="50" Source="{Binding Image}"/>
                <TextBlock Text="{Binding Descrizione}" FontSize="46" Margin="8" />
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="TitleTemplate">
            <Grid>
                <Image Margin="0,35,0,0" Source="/Assets/logo.png" Width="400"></Image>
            </Grid>
        </DataTemplate>


    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.Foreground>
        <SolidColorBrush Color="Black"/>
    </phone:PhoneApplicationPage.Foreground>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="White">
        <Grid.RowDefinitions>
        </Grid.RowDefinitions>
            <ProgressBar
            VerticalAlignment="Top"
            Background="{x:Null}"
            Margin="0,190,0,0"
            Foreground="Red"
            IsIndeterminate="{Binding IsLoading}"/>
        <!-- LOCALIZATION NOTE:
            To localize the displayed strings copy their values to appropriately named
            keys in the app's neutral language resource file (AppResources.resx) then
            replace the hard-coded text value between the attributes' quotation marks
            with the binding clause whose path points to that string name.

            For example:

                Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"

            This binding points to the template's string resource named "ApplicationTitle".

            Adding supported languages in the Project Properties tab will create a
            new resx file per language that can carry the translated values of your
            UI strings. The binding in these examples will cause the value of the
            attributes to be drawn from the .resx file that matches the
            CurrentUICulture of the app at run time.
         -->

        <!--TitlePanel contains the name of the application and page title-->

        <!--ContentPanel - place additional content here-->
        <Grid Height="104" Margin="0" VerticalAlignment="Top" Background="#FFE3AACC"/>

        <!--ContentPanel - place additional content here-->
        <controls:Panorama Name="panorama" Title="24carati.com" Foreground="Black" TitleTemplate="{StaticResource TitleTemplate}" SelectionChanged="Panorama_SelectionChanged">
            <controls:PanoramaItem Header="vetrina" x:Name="vetrinaPivot" Orientation="Horizontal">
                <toolkit:WrapPanel x:Name="wrapPanel" Orientation="Vertical"/>
            </controls:PanoramaItem>
            <controls:PanoramaItem CacheMode="{x:Null}" Header="novità">
                <ListBox SelectedItem="{Binding SelectedProduct, Mode=TwoWay}" ItemTemplate="{StaticResource VetrinaDataTemplate}" ItemsSource="{Binding Novita}" >
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <toolkit:WrapPanel Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="categorie">
                <ListBox ItemsSource="{Binding Categorie}" ItemTemplate="{StaticResource CategorieTemplate}" Foreground="Black" SelectedItem="{Binding SelectedCategory, Mode=TwoWay}" SelectionChanged="ListBox_SelectionChanged"/>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="info" Name="tabInfo">
                <StackPanel>
                    <Image Source="/Assets/Tiles/FlipCycleTileMedium.png" Width="120"></Image>
                    <TextBlock Margin="0,15,0,0" Name="versione" Text="" FontSize="24" TextAlignment="Center"/>
                   <TextBlock Margin="0,15,0,0" Text="supporto" FontSize="24" TextAlignment="Center" TextDecorations="Underline" Foreground="{StaticResource BrushViolaScuro}" Tap="Supporto_Tap"/>
                </StackPanel>
            </controls:PanoramaItem>
        </controls:Panorama>

        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar Mode="Minimized" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Assets/cart.png" Text="Carrello" Click="GoCarrello_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>